import React from 'react'
import Index from '@/views/index/Index'
import Details from '@/views/details/Details'

import { Route, Redirect } from 'react-router-dom'
import animateHoc from './hoc/animateHoc'

const IndexComponent = animateHoc(Index)
const DetailsComponent = animateHoc(Details)

export default function App() {
  return (
    <div style={{height: '100%', position: 'relative'}}>
      <Route path="/index" children={props => <IndexComponent {...props} index={1} />}></Route>
      <Route path="/details" children={props => <DetailsComponent {...props} index={2} />}></Route>
      <Redirect exact from="/" to="/index"></Redirect>
    </div>
  )
}
